﻿Imports AugmentLib.Database
Imports System.Configuration.ConfigurationManager
Imports AugmentLib.InputOutput.Encryption
Imports AugmentLib.WebComponent

Partial Class rtransCompare
    Inherits System.Web.UI.Page

    Private Sub GetAllTransactionDate(ByVal TransactionUID As Guid)

        Dim objDB As New Database(AppSettings("datasource"), AppSettings("database"), AppSettings("username"), AppSettings("password"), AppSettings("timeout"), AppSettings("pooling"))
        Dim TempDT As New Data.DataTable

        objDB.OpenConnection()
        objDB.dbVariable.SQLString = "SELECT CONVERT(VARCHAR(20), CreateDate, 100) as CreateDate,OId FROM " + AppSettings("logdatasource").ToString() + ".dbo.AW_RentTransaction WHERE TransactionId=@TransactionId"
        objDB.AddParameter("TransactionId", Data.SqlDbType.UniqueIdentifier, TransactionUID)
        objDB.FillData(TempDT, "RentTransaction", Database.SQLCommandType.NormalString)
        objDB.CloseConnection()

        Dim NewRow As Data.DataRow
        NewRow = TempDT.NewRow
        NewRow.Item("CreateDate") = "--Select One--"
        NewRow.Item("OId") = Guid.Empty
        TempDT.Rows.InsertAt(NewRow, 0)

        ddlTransaction1.DataSource = TempDT
        ddlTransaction1.DataTextField = "CreateDate"
        ddlTransaction1.DataValueField = "OId"
        ddlTransaction1.DataBind()

        ddlTransaction2.DataSource = TempDT
        ddlTransaction2.DataTextField = "CreateDate"
        ddlTransaction2.DataValueField = "OId"
        ddlTransaction2.DataBind()

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Session("StaffId") Is Nothing Then
            Response.Redirect("Default.aspx")
        Else
            lblStaffUID.Text = Session("StaffId").ToString
        End If

        If Not Page.IsPostBack Then
            If Not Request.QueryString("id") Is Nothing Then
                Dim Propertyid As String
                Propertyid = SymmetricDecryptFromHex(Request.QueryString("id"), "augment")
                GetAllTransactionDate(New Guid(Propertyid))
            End If
        End If

    End Sub

    Protected Sub ddlTransaction1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlTransaction1.SelectedIndexChanged
        If ddlTransaction1.SelectedValue <> Guid.Empty.ToString Then
            Dim objDB As New Database(AppSettings("datasource"), AppSettings("database"), AppSettings("username"), AppSettings("password"), AppSettings("timeout"), AppSettings("pooling"))
            Dim TempDT As New Data.DataTable

            objDB.OpenConnection()
            objDB.dbVariable.SQLString = "SELECT p.Project, isnull(a.UnitNumber,'') + ', ' + isnull(r.Road,'') + ', ' + isnull(l.Location,'') + ', ' + isnull(s.State,'') + ', ' + isnull(c.Country,'') as 'Address', " & _
                                   "st.OpenFileRef, st.CloseFileRef, st.InvoiceNumber, st.TransListType, st.MonthlyRental, " & _
                                   "st.TenancyDuration, st.TenancyDurationType, st.Requisition, st.TerminationClause, st.PremiseUse, " & _
                                   "st.Status, st.Renewed, st.LandlordType, st.LandlordName1, st.LandlordName2, st.LandlordName3, " & _
                                   "st.LandlordCompany, st.LandlordNRIC1, st.LandlordNRIC2, st.LandlordNRIC3, st.LandlordCompanyNo, " & _
                                   "st.LandlordContactPerson, st.LandlordAddress, st.LandlordPhone, st.LandlordMobile, st.LandlordFax, " & _
                                   "st.LandlordEmail, st.LandlordViewMeetTele, st.LandlordIncomeTax, st.LandlordReferral, st.LandlordReferralName, " & _
                                   "st.LandlordReferralNRIC, st.LandlordReferralContact, st.LandlordReferralStatus, st.LandlordReferralAmount, " & _
                                   "st.LandlordReferralAmtSum, st.AgencyFee, st.GST, st.GSTPaidBy, st.ListingFee, st.LandlordTAFee, st.TenantType, " & _
                                   "st.TenantName1, st.TenantName2, st.TenantName3, st.TenantCompany, st.TenantNRIC1, st.TenantNRIC2, st.TenantNRIC3, " & _
                                   "st.TenantCompanyNo, st.TenantContactPerson, st.TenantAddress, st.TenantPhone, st.TenantMobile, st.TenantFax, " & _
                                   "st.TenantEmail, st.TenantViewMeetTele, st.TenantIncomeTax, st.TenantReferral, st.TenantReferralName, " & _
                                   "st.TenantReferralNRIC, st.TenantReferralContact, st.TenantReferralStatus, st.TenantReferralAmount, " & _
                                   "st.DisbursementFee, st.Deposit, st.DepositMonth, st.Advance, st.AdvanceMonth, st.WaterElectric, st.Tel, " & _
                                   "st.TenantTAFee, st.SignDate, st.SignRemark, st.SignComplete, scb.Name as SignCompleteBy, scb.Initial as SignCompleteByInitial, st.SignCompleteDate, " & _
                                   "st.RentFreePeriod, st.RentFreePeriodType, st.CommencementDate, st.CollectDate, st.CollectAmt, st.CollectRemark, " & _
                                   "st.CollectComplete, ccb.Name as CollecTCompleteBy, ccb.Initial as CollecTCompleteByInitial, st.CollectCompleteDate, st.UndoDate, st.UndoRemark, st.UndoAmt, " & _
                                   "ub.Name as UndoBy, ub.Initial as UndoByInitial, st.UndoAgencyFee, st.UndoGST, st.UndoGSTPaidBy, st.UndoListerAmt FROM " + AppSettings("logdatasource").ToString() + ".dbo.AW_RentTransaction st LEFT OUTER JOIN AW_Property a ON st.PropertyId=a.PropertyId LEFT OUTER JOIN " & _
                                   "AW_Road r ON a.RoadId = r.RoadId LEFT OUTER JOIN AW_Project p ON a.ProjectId = p.ProjectId " & _
                                   "LEFT OUTER JOIN AW_Location l ON r.LocationId = l.LocationId LEFT OUTER JOIN AW_State s ON l.StateId = s.StateId " & _
                                   "LEFT OUTER JOIN AW_Country c on s.CountryId = c.CountryId LEFT OUTER JOIN AW_Staff scb ON st.SignCompleteBy=scb.StaffId " & _
                                   "LEFT OUTER JOIN AW_Staff ccb ON st.CollectCompleteBy= ccb.StaffId LEFT OUTER JOIN AW_Staff ub ON " & _
                                   "st.UndoBy=ub.StaffId WHERE st.OId = @OId"
            objDB.AddParameter("OID", Data.SqlDbType.UniqueIdentifier, New Guid(ddlTransaction1.SelectedValue))
            objDB.FillData(TempDT, "Transaction", Database.SQLCommandType.NormalString)
            objDB.CloseConnection()

            For Each ReadRow As Data.DataRow In TempDT.Rows

                lblAddress1.Text = ReadRow.Item("Address").ToString
                lblProject1.Text = ReadRow.Item("Project").ToString
                lblOpenFileRef1.Text = ReadRow.Item("OpenFileRef").ToString
                lblClosedFileRef1.Text = ReadRow.Item("CloseFileRef").ToString
                lblInvoiceNum1.Text = ReadRow.Item("InvoiceNumber").ToString
                If ReadRow.Item("TransListType").ToString = "1" Then
                    lblTransactAs1.Text = "RR"
                ElseIf ReadRow.Item("TransListType").ToString = "2" Then
                    lblTransactAs1.Text = "RC"
                ElseIf ReadRow.Item("TransListType").ToString = "3" Then
                    lblTransactAs1.Text = "RL"
                ElseIf ReadRow.Item("TransListType").ToString = "4" Then
                    lblTransactAs1.Text = "RI"
                Else
                    lblTransactAs1.Text = ""
                End If
                lblMonthlyRental1.Text = ReadRow.Item("MonthlyRental").ToString
                If ReadRow.Item("TenancyDurationType").ToString = "0" Then
                    lblTenancyDuration1.Text = ReadRow.Item("TenancyDuration").ToString & " Years"
                ElseIf ReadRow.Item("TenancyDurationType").ToString = "1" Then
                    lblTenancyDuration1.Text = ReadRow.Item("TenancyDuration").ToString & " Months"
                ElseIf ReadRow.Item("TenancyDurationType").ToString = "2" Then
                    lblTenancyDuration1.Text = ReadRow.Item("TenancyDuration").ToString & " Days"
                Else
                    lblTenancyDuration1.Text = ""
                End If
                lblRequisition1.Text = ReadRow.Item("Requisition").ToString
                lblTerminationClause1.Text = ReadRow.Item("TerminationClause").ToString
                If ReadRow.Item("PremiseUse").ToString = "0" Then
                    lblPremiseUse1.Text = "Residential"
                ElseIf ReadRow.Item("PremiseUse").ToString = "1" Then
                    lblPremiseUse1.Text = "Commercial"
                ElseIf ReadRow.Item("PremiseUse").ToString = "2" Then
                    lblPremiseUse1.Text = "Land"
                ElseIf ReadRow.Item("PremiseUse").ToString = "3" Then
                    lblPremiseUse1.Text = "Industrial"
                ElseIf ReadRow.Item("PremiseUse").ToString = "4" Then
                    lblPremiseUse1.Text = "Agriculture"
                Else
                    lblPremiseUse1.Text = ""
                End If
                If ReadRow.Item("Status").ToString = "0" Then
                    lblStatus1.Text = "New"
                ElseIf ReadRow.Item("Status").ToString = "1" Then
                    lblStatus1.Text = "Pending Signing"
                ElseIf ReadRow.Item("Status").ToString = "2" Then
                    lblStatus1.Text = "Pending Collection"
                ElseIf ReadRow.Item("Status").ToString = "3" Then
                    lblStatus1.Text = "Completed"
                ElseIf ReadRow.Item("Status").ToString = "4" Then
                    lblStatus1.Text = "Relist"
                ElseIf ReadRow.Item("Status").ToString = "5" Then
                    lblStatus1.Text = "Renew"
                Else
                    lblStatus1.Text = ""
                End If
                If ReadRow.Item("Renewed").ToString = "0" Then
                    lblRenew1.Text = "New Transaction"
                ElseIf ReadRow.Item("Renewed").ToString = "1" Then
                    lblRenew1.Text = "Renewed Transaction"
                Else
                    lblRenew1.Text = ""
                End If

                If ReadRow.Item("LandlordType").ToString = "0" Then
                    lblLandlordType1.Text = "Own"
                ElseIf ReadRow.Item("LandlordType").ToString = "1" Then
                    lblLandlordType1.Text = "Company"
                Else
                    lblLandlordType1.Text = ""
                End If
                lblLandlordName11.Text = ReadRow.Item("LandlordName1").ToString
                lblLandlordName21.Text = ReadRow.Item("LandlordName2").ToString
                lblLandlordName31.Text = ReadRow.Item("LandlordName3").ToString
                lblLandlordCompany1.Text = ReadRow.Item("LandlordCompany").ToString
                lblLandlordNRIC11.Text = ReadRow.Item("LandlordNRIC1").ToString
                lblLandlordNRIC21.Text = ReadRow.Item("LandlordNRIC2").ToString
                lblLandlordNRIC31.Text = ReadRow.Item("LandlordNRIC3").ToString
                lblLandlordCompanyNo1.Text = ReadRow.Item("LandlordCompanyNo").ToString
                lblLandlordContactPerson1.Text = ReadRow.Item("LandlordContactPerson").ToString
                lblLandlordAddress1.Text = ReadRow.Item("LandlordAddress").ToString
                lblLandlordPhone1.Text = ReadRow.Item("LandlordPhone").ToString
                lblLandlordMobile1.Text = ReadRow.Item("LandlordMobile").ToString
                lblLandlordFax1.Text = ReadRow.Item("LandlordFax").ToString
                lblLandlordEmail1.Text = ReadRow.Item("LandlordEmail").ToString
                lblLandlordVMT1.Text = ReadRow.Item("LandlordViewMeetTele").ToString
                lblLandlordIncomeTax1.Text = ReadRow.Item("LandlordIncomeTax").ToString
                If ReadRow.Item("LandlordReferral").ToString = "1" Then
                    lblLandlordReferral1.Text = "☑"
                Else
                    lblLandlordReferral1.Text = ""
                End If
                lblLandlordReferralName1.Text = ReadRow.Item("LandlordReferralName").ToString
                lblLandlordReferralNRIC1.Text = ReadRow.Item("LandlordReferralNRIC").ToString
                lblLandlordReferralContact1.Text = ReadRow.Item("LandlordReferralContact").ToString
                If ReadRow.Item("LandlordReferralStatus").ToString = "1" Then
                    lblLandlordReferralStatus1.Text = "Landlord"
                ElseIf ReadRow.Item("LandlordReferralStatus").ToString = "2" Then
                    lblLandlordReferralStatus1.Text = "Tenant"
                Else
                    lblLandlordReferralStatus1.Text = ""
                End If
                lblLandlordReferralAmount1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("LandlordReferralAmount"))
                lblAgencyFee1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("AgencyFee"))
                If ReadRow.Item("GSTPaidBy").ToString = "1" Then
                    lblGSTPaidBy1.Text = "Landlord"
                ElseIf ReadRow.Item("GSTPaidBy").ToString = "2" Then
                    lblGSTPaidBy1.Text = "Company"
                Else
                    lblGSTPaidBy1.Text = ""
                End If
                lblListing1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("ListingFee"))
                lblLandlordTAFee1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("LandlordTAFee"))

                If ReadRow.Item("TenantType").ToString = "0" Then
                    lblTenantType1.Text = "Own"
                ElseIf ReadRow.Item("TenantType").ToString = "1" Then
                    lblTenantType1.Text = "Company"
                Else
                    lblTenantType1.Text = ""
                End If
                lblTenantName11.Text = ReadRow.Item("TenantName1").ToString
                lblTenantName21.Text = ReadRow.Item("TenantName2").ToString
                lblTenantName31.Text = ReadRow.Item("TenantName3").ToString
                lblTenantCompany1.Text = ReadRow.Item("TenantCompany").ToString
                lblTenantNRIC11.Text = ReadRow.Item("TenantNRIC1").ToString
                lblTenantNRIC21.Text = ReadRow.Item("TenantNRIC2").ToString
                lblTenantNRIC31.Text = ReadRow.Item("TenantNRIC3").ToString
                lblTenantCompanyNo1.Text = ReadRow.Item("TenantCompanyNo").ToString
                lblTenantContactPerson1.Text = ReadRow.Item("TenantContactPerson").ToString
                lblTenantAddress1.Text = ReadRow.Item("TenantAddress").ToString
                lblTenantPhone1.Text = ReadRow.Item("TenantPhone").ToString
                lblTenantMobile1.Text = ReadRow.Item("TenantMobile").ToString
                lblTenantFax1.Text = ReadRow.Item("TenantFax").ToString
                lblTenantEmail1.Text = ReadRow.Item("TenantEmail").ToString
                lblTenantVMT1.Text = ReadRow.Item("TenantViewMeetTele").ToString
                lblTenantIncomeTax1.Text = ReadRow.Item("TenantIncomeTax").ToString
                If ReadRow.Item("TenantReferral").ToString = "1" Then
                    lblTenantReferral1.Text = "☑"
                Else
                    lblTenantReferral1.Text = ""
                End If
                lblTenantReferralName1.Text = ReadRow.Item("TenantReferralName").ToString
                lblTenantReferralNRIC1.Text = ReadRow.Item("TenantReferralNRIC").ToString
                lblTenantReferralContact1.Text = ReadRow.Item("TenantReferralContact").ToString
                If ReadRow.Item("TenantReferralStatus").ToString = "1" Then
                    lblTenantReferralStatus1.Text = "Tenant"
                ElseIf ReadRow.Item("TenantReferralStatus").ToString = "2" Then
                    lblTenantReferralStatus1.Text = "Landlord"
                Else
                    lblTenantReferralStatus1.Text = ""
                End If
                lblTenantReferralAmount1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("TenantReferralAmount"))
                lblDisbursementFee1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("DisbursementFee"))
                lblDeposit1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("Deposit"))
                lblDepositMonth1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("DepositMonth"))
                lblAdvance1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("Advance"))
                lblAdvanceMonth1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("AdvanceMonth"))
                lblWaterElectric1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("WaterElectric"))
                lblTel1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("Tel"))
                lblTenantTAFee1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("TenantTAFee"))

                If ReadRow.Item("SignDate").ToString = "" Then
                    lblSignDate1.Text = ""
                Else
                    lblSignDate1.Text = Format(ReadRow.Item("SignDate"), "dd-MMM-yyyy")
                End If
                lblSignRemark1.Text = ReadRow.Item("SignRemark").ToString
                If ReadRow.Item("SignComplete").ToString = "1" Then
                    lblSignCompletion1.Text = "☑"
                Else
                    lblSignCompletion1.Text = ""
                End If
                lblSignCompletionBy1.Text = ReadRow.Item("SignCompleteByInitial").ToString
                'lblSignCompletionBy1.Text = ReadRow.Item("SignCompleteBy").ToString
                If ReadRow.Item("SignCompleteDate").ToString = "" Then
                    lblSignCompletionDate1.Text = ""
                Else
                    lblSignCompletionDate1.Text = Format(ReadRow.Item("SignCompleteDate"), "dd-MMM-yyyy")
                End If
                If ReadRow.Item("CommencementDate").ToString = "" Then
                    lblCommencementDate1.Text = ""
                Else
                    lblCommencementDate1.Text = Format(ReadRow.Item("CommencementDate"), "dd-MMM-yyyy")
                End If
                If ReadRow.Item("RentFreePeriodType").ToString = "1" Then
                    lblRentFreePeriod1.Text = ReadRow.Item("RentFreePeriod").ToString & " Years"
                ElseIf ReadRow.Item("RentFreePeriodType").ToString = "2" Then
                    lblRentFreePeriod1.Text = ReadRow.Item("RentFreePeriod").ToString & " Months"
                ElseIf ReadRow.Item("RentFreePeriodType").ToString = "3" Then
                    lblRentFreePeriod1.Text = ReadRow.Item("RentFreePeriod").ToString & " Day"
                Else
                    lblRentFreePeriod1.Text = ""
                End If

                If ReadRow.Item("CollectDate").ToString = "" Then
                    lblCollectionDate1.Text = ""
                Else
                    lblCollectionDate1.Text = Format(ReadRow.Item("CollectDate"), "dd-MMM-yyyy")
                End If
                If IsDBNull(ReadRow.Item("CollectAmt")) Then
                    lblCollectedAmount1.Text = ""
                Else
                    lblCollectedAmount1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("CollectAmt"))
                End If
                lblCollectionRemark1.Text = ReadRow.Item("CollectRemark").ToString
                If ReadRow.Item("CollectComplete").ToString = "1" Then
                    lblCollectionCompletion1.Text = "☑"
                Else
                    lblCollectionCompletion1.Text = ""
                End If
                'lblCollectionCompletionBy1.Text = ReadRow.Item("CollectCompleteBy").ToString
                lblCollectionCompletionBy1.Text = ReadRow.Item("CollectCompleteByInitial").ToString
                If ReadRow.Item("CollectCompleteDate").ToString = "" Then
                    lblCollectionCompletionDate1.Text = ""
                Else
                    lblCollectionCompletionDate1.Text = Format(ReadRow.Item("CollectCompleteDate"), "dd-MMM-yyyy")
                End If

                If ReadRow.Item("UndoDate").ToString = "" Then
                    lblUndoDate1.Text = ""
                Else
                    lblUndoDate1.Text = Format(ReadRow.Item("UndoDate"), "dd-MMM-yyyy")
                End If
                lblUndoRemark1.Text = ReadRow.Item("UndoRemark").ToString
                If IsDBNull(ReadRow.Item("UndoAmt")) Then
                    lblUndoAmt1.Text = ""
                Else
                    lblUndoAmt1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("UndoAmt"))
                End If
                'lblUndoBy1.Text = ReadRow.Item("UndoBy").ToString
                lblUndoBy1.Text = ReadRow.Item("UndoByInitial").ToString
                If IsDBNull(ReadRow.Item("UndoAgencyFee")) Then
                    lblUndoAgencyFee1.Text = ""
                Else
                    lblUndoAgencyFee1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("UndoAgencyFee"))
                End If
                'lblUndoGST1.Text = ReadRow.Item("UndoGST").ToString
                If IsDBNull(ReadRow.Item("UndoGST")) Then
                    lblUndoGST1.Text = ""
                Else
                    lblUndoGST1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("UndoGST"))
                End If
                If ReadRow.Item("UndoGSTPaidBy").ToString = "1" Then
                    lblUndoGSTPaidBy1.Text = "Landlord"
                ElseIf ReadRow.Item("UndoGSTPaidBy").ToString = "2" Then
                    lblUndoGSTPaidBy1.Text = "Company"
                Else
                    lblUndoGSTPaidBy1.Text = ""
                End If
                If IsDBNull(ReadRow.Item("UndoListerAmt")) Then
                    lblUndoListerAmount1.Text = ""
                Else
                    lblUndoListerAmount1.Text = String.Format("{0:#,##0.00}", ReadRow.Item("UndoListerAmt"))
                End If
            Next

            If ddlTransaction2.SelectedValue <> Guid.Empty.ToString Then
                Comparison()
            End If
        End If
    End Sub

    Protected Sub ddlTransaction2_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlTransaction2.SelectedIndexChanged
        If ddlTransaction2.SelectedValue <> Guid.Empty.ToString Then
            Dim objDB As New Database(AppSettings("datasource"), AppSettings("database"), AppSettings("username"), AppSettings("password"), AppSettings("timeout"), AppSettings("pooling"))
            Dim TempDT As New Data.DataTable

            objDB.OpenConnection()
            objDB.dbVariable.SQLString = "SELECT p.Project, isnull(a.UnitNumber,'') + ', ' + isnull(r.Road,'') + ', ' + isnull(l.Location,'') + ', ' + isnull(s.State,'') + ', ' + isnull(c.Country,'') as 'Address', " & _
                                   "st.OpenFileRef, st.CloseFileRef, st.InvoiceNumber, st.TransListType, st.MonthlyRental, " & _
                                   "st.TenancyDuration, st.TenancyDurationType, st.Requisition, st.TerminationClause, st.PremiseUse, " & _
                                   "st.Status, st.Renewed, st.LandlordType, st.LandlordName1, st.LandlordName2, st.LandlordName3, " & _
                                   "st.LandlordCompany, st.LandlordNRIC1, st.LandlordNRIC2, st.LandlordNRIC3, st.LandlordCompanyNo, " & _
                                   "st.LandlordContactPerson, st.LandlordAddress, st.LandlordPhone, st.LandlordMobile, st.LandlordFax, " & _
                                   "st.LandlordEmail, st.LandlordViewMeetTele, st.LandlordIncomeTax, st.LandlordReferral, st.LandlordReferralName, " & _
                                   "st.LandlordReferralNRIC, st.LandlordReferralContact, st.LandlordReferralStatus, st.LandlordReferralAmount, " & _
                                   "st.LandlordReferralAmtSum, st.AgencyFee, st.GST, st.GSTPaidBy, st.ListingFee, st.LandlordTAFee, st.TenantType, " & _
                                   "st.TenantName1, st.TenantName2, st.TenantName3, st.TenantCompany, st.TenantNRIC1, st.TenantNRIC2, st.TenantNRIC3, " & _
                                   "st.TenantCompanyNo, st.TenantContactPerson, st.TenantAddress, st.TenantPhone, st.TenantMobile, st.TenantFax, " & _
                                   "st.TenantEmail, st.TenantViewMeetTele, st.TenantIncomeTax, st.TenantReferral, st.TenantReferralName, " & _
                                   "st.TenantReferralNRIC, st.TenantReferralContact, st.TenantReferralStatus, st.TenantReferralAmount, " & _
                                   "st.DisbursementFee, st.Deposit, st.DepositMonth, st.Advance, st.AdvanceMonth, st.WaterElectric, st.Tel, " & _
                                   "st.TenantTAFee, st.SignDate, st.SignRemark, st.SignComplete, scb.Name as SignCompleteBy, scb.Initial as SignCompleteByInitial, st.SignCompleteDate, " & _
                                   "st.RentFreePeriod, st.RentFreePeriodType, st.CommencementDate, st.CollectDate, st.CollectAmt, st.CollectRemark, " & _
                                   "st.CollectComplete, ccb.Name as CollecTCompleteBy, ccb.Initial as CollecTCompleteByInitial, st.CollectCompleteDate, st.UndoDate, st.UndoRemark, st.UndoAmt, " & _
                                   "ub.Name as UndoBy, ub.Initial as UndoByInitial, st.UndoAgencyFee, st.UndoGST, st.UndoGSTPaidBy, st.UndoListerAmt FROM " + AppSettings("logdatasource").ToString() + ".dbo.AW_RentTransaction st LEFT OUTER JOIN AW_Property a ON st.PropertyId=a.PropertyId LEFT OUTER JOIN " & _
                                   "AW_Road r ON a.RoadId = r.RoadId LEFT OUTER JOIN AW_Project p ON a.ProjectId = p.ProjectId " & _
                                   "LEFT OUTER JOIN AW_Location l ON r.LocationId = l.LocationId LEFT OUTER JOIN AW_State s ON l.StateId = s.StateId " & _
                                   "LEFT OUTER JOIN AW_Country c on s.CountryId = c.CountryId LEFT OUTER JOIN AW_Staff scb ON st.SignCompleteBy=scb.StaffId " & _
                                   "LEFT OUTER JOIN AW_Staff ccb ON st.CollectCompleteBy= ccb.StaffId LEFT OUTER JOIN AW_Staff ub ON " & _
                                   "st.UndoBy=ub.StaffId WHERE st.OId = @OId"
            objDB.AddParameter("OID", Data.SqlDbType.UniqueIdentifier, New Guid(ddlTransaction2.SelectedValue))
            objDB.FillData(TempDT, "Transaction", Database.SQLCommandType.NormalString)
            objDB.CloseConnection()

            For Each ReadRow As Data.DataRow In TempDT.Rows

                lblAddress2.Text = ReadRow.Item("Address").ToString
                lblProject2.Text = ReadRow.Item("Project").ToString
                lblOpenFileRef2.Text = ReadRow.Item("OpenFileRef").ToString
                lblClosedFileRef2.Text = ReadRow.Item("CloseFileRef").ToString
                lblInvoiceNum2.Text = ReadRow.Item("InvoiceNumber").ToString
                If ReadRow.Item("TransListType").ToString = "1" Then
                    lblTransactAs2.Text = "RR"
                ElseIf ReadRow.Item("TransListType").ToString = "2" Then
                    lblTransactAs2.Text = "RC"
                ElseIf ReadRow.Item("TransListType").ToString = "3" Then
                    lblTransactAs2.Text = "RL"
                ElseIf ReadRow.Item("TransListType").ToString = "4" Then
                    lblTransactAs2.Text = "RI"
                Else
                    lblTransactAs2.Text = ""
                End If
                lblMonthlyRental2.Text = ReadRow.Item("MonthlyRental").ToString
                If ReadRow.Item("TenancyDurationType").ToString = "0" Then
                    lblTenancyDuration2.Text = ReadRow.Item("TenancyDuration").ToString & " Years"
                ElseIf ReadRow.Item("TenancyDurationType").ToString = "1" Then
                    lblTenancyDuration2.Text = ReadRow.Item("TenancyDuration").ToString & " Months"
                ElseIf ReadRow.Item("TenancyDurationType").ToString = "2" Then
                    lblTenancyDuration2.Text = ReadRow.Item("TenancyDuration").ToString & " Days"
                Else
                    lblTenancyDuration2.Text = ""
                End If
                lblRequisition2.Text = ReadRow.Item("Requisition").ToString
                lblTerminationClause2.Text = ReadRow.Item("TerminationClause").ToString
                If ReadRow.Item("PremiseUse").ToString = "0" Then
                    lblPremiseUse2.Text = "Residential"
                ElseIf ReadRow.Item("PremiseUse").ToString = "1" Then
                    lblPremiseUse2.Text = "Commercial"
                ElseIf ReadRow.Item("PremiseUse").ToString = "2" Then
                    lblPremiseUse2.Text = "Land"
                ElseIf ReadRow.Item("PremiseUse").ToString = "3" Then
                    lblPremiseUse2.Text = "Industrial"
                ElseIf ReadRow.Item("PremiseUse").ToString = "4" Then
                    lblPremiseUse2.Text = "Agriculture"
                Else
                    lblPremiseUse2.Text = ""
                End If
                If ReadRow.Item("Status").ToString = "0" Then
                    lblStatus2.Text = "New"
                ElseIf ReadRow.Item("Status").ToString = "1" Then
                    lblStatus2.Text = "Pending Signing"
                ElseIf ReadRow.Item("Status").ToString = "2" Then
                    lblStatus2.Text = "Pending Collection"
                ElseIf ReadRow.Item("Status").ToString = "3" Then
                    lblStatus2.Text = "Completed"
                ElseIf ReadRow.Item("Status").ToString = "4" Then
                    lblStatus2.Text = "Relist"
                ElseIf ReadRow.Item("Status").ToString = "5" Then
                    lblStatus2.Text = "Renew"
                Else
                    lblStatus2.Text = ""
                End If
                If ReadRow.Item("Renewed").ToString = "0" Then
                    lblRenew2.Text = "New Transaction"
                ElseIf ReadRow.Item("Renewed").ToString = "1" Then
                    lblRenew2.Text = "Renewed Transaction"
                Else
                    lblRenew2.Text = ""
                End If

                If ReadRow.Item("LandlordType").ToString = "0" Then
                    lblLandlordType2.Text = "Own"
                ElseIf ReadRow.Item("LandlordType").ToString = "1" Then
                    lblLandlordType2.Text = "Company"
                Else
                    lblLandlordType2.Text = ""
                End If
                lblLandlordName12.Text = ReadRow.Item("LandlordName1").ToString
                lblLandlordName22.Text = ReadRow.Item("LandlordName2").ToString
                lblLandlordName32.Text = ReadRow.Item("LandlordName3").ToString
                lblLandlordCompany2.Text = ReadRow.Item("LandlordCompany").ToString
                lblLandlordNRIC12.Text = ReadRow.Item("LandlordNRIC1").ToString
                lblLandlordNRIC22.Text = ReadRow.Item("LandlordNRIC2").ToString
                lblLandlordNRIC32.Text = ReadRow.Item("LandlordNRIC3").ToString
                lblLandlordCompanyNo2.Text = ReadRow.Item("LandlordCompanyNo").ToString
                lblLandlordContactPerson2.Text = ReadRow.Item("LandlordContactPerson").ToString
                lblLandlordAddress2.Text = ReadRow.Item("LandlordAddress").ToString
                lblLandlordPhone2.Text = ReadRow.Item("LandlordPhone").ToString
                lblLandlordMobile2.Text = ReadRow.Item("LandlordMobile").ToString
                lblLandlordFax2.Text = ReadRow.Item("LandlordFax").ToString
                lblLandlordEmail2.Text = ReadRow.Item("LandlordEmail").ToString
                lblLandlordVMT2.Text = ReadRow.Item("LandlordViewMeetTele").ToString
                lblLandlordIncomeTax2.Text = ReadRow.Item("LandlordIncomeTax").ToString
                If ReadRow.Item("LandlordReferral").ToString = "1" Then
                    lblLandlordReferral2.Text = "☑"
                Else
                    lblLandlordReferral2.Text = ""
                End If
                lblLandlordReferralName2.Text = ReadRow.Item("LandlordReferralName").ToString
                lblLandlordReferralNRIC2.Text = ReadRow.Item("LandlordReferralNRIC").ToString
                lblLandlordReferralContact2.Text = ReadRow.Item("LandlordReferralContact").ToString
                If ReadRow.Item("LandlordReferralStatus").ToString = "1" Then
                    lblLandlordReferralStatus2.Text = "Landlord"
                ElseIf ReadRow.Item("LandlordReferralStatus").ToString = "2" Then
                    lblLandlordReferralStatus2.Text = "Tenant"
                Else
                    lblLandlordReferralStatus2.Text = ""
                End If
                lblLandlordReferralAmount2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("LandlordReferralAmount"))
                lblAgencyFee2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("AgencyFee"))
                If ReadRow.Item("GSTPaidBy").ToString = "1" Then
                    lblGSTPaidBy2.Text = "Landlord"
                ElseIf ReadRow.Item("GSTPaidBy").ToString = "2" Then
                    lblGSTPaidBy2.Text = "Company"
                Else
                    lblGSTPaidBy2.Text = ""
                End If
                lblListing2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("ListingFee"))
                lblLandlordTAFee2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("LandlordTAFee"))

                If ReadRow.Item("TenantType").ToString = "0" Then
                    lblTenantType2.Text = "Own"
                ElseIf ReadRow.Item("TenantType").ToString = "1" Then
                    lblTenantType2.Text = "Company"
                Else
                    lblTenantType2.Text = ""
                End If
                lblTenantName12.Text = ReadRow.Item("TenantName1").ToString
                lblTenantName22.Text = ReadRow.Item("TenantName2").ToString
                lblTenantName32.Text = ReadRow.Item("TenantName3").ToString
                lblTenantCompany2.Text = ReadRow.Item("TenantCompany").ToString
                lblTenantNRIC12.Text = ReadRow.Item("TenantNRIC1").ToString
                lblTenantNRIC22.Text = ReadRow.Item("TenantNRIC2").ToString
                lblTenantNRIC32.Text = ReadRow.Item("TenantNRIC3").ToString
                lblTenantCompanyNo2.Text = ReadRow.Item("TenantCompanyNo").ToString
                lblTenantContactPerson2.Text = ReadRow.Item("TenantContactPerson").ToString
                lblTenantAddress2.Text = ReadRow.Item("TenantAddress").ToString
                lblTenantPhone2.Text = ReadRow.Item("TenantPhone").ToString
                lblTenantMobile2.Text = ReadRow.Item("TenantMobile").ToString
                lblTenantFax2.Text = ReadRow.Item("TenantFax").ToString
                lblTenantEmail2.Text = ReadRow.Item("TenantEmail").ToString
                lblTenantVMT2.Text = ReadRow.Item("TenantViewMeetTele").ToString
                lblTenantIncomeTax2.Text = ReadRow.Item("TenantIncomeTax").ToString
                If ReadRow.Item("TenantReferral").ToString = "1" Then
                    lblTenantReferral2.Text = "☑"
                Else
                    lblTenantReferral2.Text = ""
                End If
                lblTenantReferralName2.Text = ReadRow.Item("TenantReferralName").ToString
                lblTenantReferralNRIC2.Text = ReadRow.Item("TenantReferralNRIC").ToString
                lblTenantReferralContact2.Text = ReadRow.Item("TenantReferralContact").ToString
                If ReadRow.Item("TenantReferralStatus").ToString = "1" Then
                    lblTenantReferralStatus2.Text = "Tenant"
                ElseIf ReadRow.Item("TenantReferralStatus").ToString = "2" Then
                    lblTenantReferralStatus2.Text = "Landlord"
                Else
                    lblTenantReferralStatus2.Text = ""
                End If
                lblTenantReferralAmount2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("TenantReferralAmount"))
                lblDisbursementFee2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("DisbursementFee"))
                lblDeposit2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("Deposit"))
                lblDepositMonth2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("DepositMonth"))
                lblAdvance2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("Advance"))
                lblAdvanceMonth2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("AdvanceMonth"))
                lblWaterElectric2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("WaterElectric"))
                lblTel2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("Tel"))
                lblTenantTAFee2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("TenantTAFee"))

                If ReadRow.Item("SignDate").ToString = "" Then
                    lblSignDate2.Text = ""
                Else
                    lblSignDate2.Text = Format(ReadRow.Item("SignDate"), "dd-MMM-yyyy")
                End If
                lblSignRemark2.Text = ReadRow.Item("SignRemark").ToString
                If ReadRow.Item("SignComplete").ToString = "1" Then
                    lblSignCompletion2.Text = "☑"
                Else
                    lblSignCompletion2.Text = ""
                End If
                'lblSignCompletionBy2.Text = ReadRow.Item("SignCompleteBy").ToString
                lblSignCompletionBy2.Text = ReadRow.Item("SignCompleteByInitial").ToString
                If ReadRow.Item("SignCompleteDate").ToString = "" Then
                    lblSignCompletionDate2.Text = ""
                Else
                    lblSignCompletionDate2.Text = Format(ReadRow.Item("SignCompleteDate"), "dd-MMM-yyyy")
                End If
                If ReadRow.Item("CommencementDate").ToString = "" Then
                    lblCommencementDate2.Text = ""
                Else
                    lblCommencementDate2.Text = Format(ReadRow.Item("CommencementDate"), "dd-MMM-yyyy")
                End If
                If ReadRow.Item("RentFreePeriodType").ToString = "1" Then
                    lblRentFreePeriod2.Text = ReadRow.Item("RentFreePeriod").ToString & " Years"
                ElseIf ReadRow.Item("RentFreePeriodType").ToString = "2" Then
                    lblRentFreePeriod2.Text = ReadRow.Item("RentFreePeriod").ToString & " Months"
                ElseIf ReadRow.Item("RentFreePeriodType").ToString = "3" Then
                    lblRentFreePeriod2.Text = ReadRow.Item("RentFreePeriod").ToString & " Day"
                Else
                    lblRentFreePeriod2.Text = ""
                End If

                If ReadRow.Item("CollectDate").ToString = "" Then
                    lblCollectionDate2.Text = ""
                Else
                    lblCollectionDate2.Text = Format(ReadRow.Item("CollectDate"), "dd-MMM-yyyy")
                End If
                If IsDBNull(ReadRow.Item("CollectAmt")) Then
                    lblCollectedAmount2.Text = ""
                Else
                    lblCollectedAmount2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("CollectAmt"))
                End If
                lblCollectionRemark2.Text = ReadRow.Item("CollectRemark").ToString
                If ReadRow.Item("CollectComplete").ToString = "1" Then
                    lblCollectionCompletion2.Text = "☑"
                Else
                    lblCollectionCompletion2.Text = ""
                End If
                'lblCollectionCompletionBy2.Text = ReadRow.Item("CollectCompleteBy").ToString
                lblCollectionCompletionBy2.Text = ReadRow.Item("CollectCompleteByInitial").ToString
                If ReadRow.Item("CollectCompleteDate").ToString = "" Then
                    lblCollectionCompletionDate2.Text = ""
                Else
                    lblCollectionCompletionDate2.Text = Format(ReadRow.Item("CollectCompleteDate"), "dd-MMM-yyyy")
                End If

                If ReadRow.Item("UndoDate").ToString = "" Then
                    lblUndoDate2.Text = ""
                Else
                    lblUndoDate2.Text = Format(ReadRow.Item("UndoDate"), "dd-MMM-yyyy")
                End If
                lblUndoRemark2.Text = ReadRow.Item("UndoRemark").ToString
                If IsDBNull(ReadRow.Item("UndoAmt")) Then
                    lblUndoAmt2.Text = ""
                Else
                    lblUndoAmt2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("UndoAmt"))
                End If
                lblUndoBy2.Text = ReadRow.Item("UndoByInitial").ToString
                'lblUndoBy2.Text = ReadRow.Item("UndoBy").ToString
                If IsDBNull(ReadRow.Item("UndoAgencyFee")) Then
                    lblUndoAgencyFee2.Text = ""
                Else
                    lblUndoAgencyFee2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("UndoAgencyFee"))
                End If
                If IsDBNull(ReadRow.Item("UndoGST")) Then
                    lblUndoGST2.Text = ""
                Else
                    lblUndoGST2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("UndoGST"))
                End If
                If ReadRow.Item("UndoGSTPaidBy").ToString = "1" Then
                    lblUndoGSTPaidBy2.Text = "Landlord"
                ElseIf ReadRow.Item("UndoGSTPaidBy").ToString = "2" Then
                    lblUndoGSTPaidBy2.Text = "Company"
                Else
                    lblUndoGSTPaidBy2.Text = ""
                End If
                If IsDBNull(ReadRow.Item("UndoListerAmt")) Then
                    lblUndoListerAmount2.Text = ""
                Else
                    lblUndoListerAmount2.Text = String.Format("{0:#,##0.00}", ReadRow.Item("UndoListerAmt"))
                End If
            Next

            If ddlTransaction1.SelectedValue <> Guid.Empty.ToString Then
                Comparison()
            End If
        End If
    End Sub

    Private Sub Comparison()
        'a4db90
        'General Information
        If lblAddress1.Text.ToUpper.Trim <> lblAddress2.Text.ToUpper.Trim Then
            trAddress.BgColor = "#A4DB90"
        End If

        If lblProject1.Text.ToUpper.Trim <> lblProject2.Text.ToUpper.Trim Then
            trProject.BgColor = "#A4DB90"
        End If

        If lblOpenFileRef1.Text.ToUpper.Trim <> lblOpenFileRef2.Text.ToUpper.Trim Then
            trOpenFileRef.BgColor = "#A4DB90"
        End If

        If lblClosedFileRef1.Text.ToUpper.Trim <> lblClosedFileRef2.Text.ToUpper.Trim Then
            trClosedFileRef.BgColor = "#A4DB90"
        End If

        If lblInvoiceNum1.Text.ToUpper.Trim <> lblInvoiceNum2.Text.ToUpper.Trim Then
            trInvoiceNum.BgColor = "#A4DB90"
        End If

        If lblTransactAs1.Text.ToUpper.Trim <> lblTransactAs2.Text.ToUpper.Trim Then
            trTransactAs.BgColor = "#A4DB90"
        End If

        If lblMonthlyRental1.Text.ToUpper.Trim <> lblMonthlyRental2.Text.ToUpper.Trim Then
            trMonthlyRental.BgColor = "#A4DB90"
        End If

        If lblTenancyDuration1.Text.ToUpper.Trim <> lblTenancyDuration2.Text.ToUpper.Trim Then
            trTenancyDuration.BgColor = "#A4DB90"
        End If

        If lblRequisition1.Text.ToUpper.Trim <> lblRequisition2.Text.ToUpper.Trim Then
            trRequisition.BgColor = "#A4DB90"
        End If

        If lblTerminationClause1.Text.ToUpper.Trim <> lblTerminationClause2.Text.ToUpper.Trim Then
            trTerminationClause.BgColor = "#A4DB90"
        End If

        If lblPremiseUse1.Text.ToUpper.Trim <> lblPremiseUse2.Text.ToUpper.Trim Then
            trPremiseUse.BgColor = "#A4DB90"
        End If

        If lblStatus1.Text.ToUpper.Trim <> lblStatus2.Text.ToUpper.Trim Then
            trStatus.BgColor = "#A4DB90"
        End If

        If lblRenew1.Text.ToUpper.Trim <> lblRenew2.Text.ToUpper.Trim Then
            trRenew.BgColor = "#A4DB90"
        End If

        If lblLandlordType1.Text.ToUpper.Trim <> lblLandlordType2.Text.ToUpper.Trim Then
            trLandlordType.BgColor = "#A4DB90"
        End If

        If lblLandlordName11.Text.ToUpper.Trim <> lblLandlordName12.Text.ToUpper.Trim Then
            trLandlordName1.BgColor = "#A4DB90"
        End If

        If lblLandlordName21.Text.ToUpper.Trim <> lblLandlordName22.Text.ToUpper.Trim Then
            trLandlordName2.BgColor = "#A4DB90"
        End If

        If lblLandlordName31.Text.ToUpper.Trim <> lblLandlordName32.Text.ToUpper.Trim Then
            trLandlordName3.BgColor = "#A4DB90"
        End If

        If lblLandlordNRIC11.Text.ToUpper.Trim <> lblLandlordNRIC12.Text.ToUpper.Trim Then
            trLandlordNRIC1.BgColor = "#A4DB90"
        End If

        If lblLandlordNRIC21.Text.ToUpper.Trim <> lblLandlordNRIC22.Text.ToUpper.Trim Then
            trLandlordNRIC2.BgColor = "#A4DB90"
        End If

        If lblLandlordNRIC31.Text.ToUpper.Trim <> lblLandlordNRIC32.Text.ToUpper.Trim Then
            trLandlordNRIC3.BgColor = "#A4DB90"
        End If

        If lblLandlordCompany1.Text.ToUpper.Trim <> lblLandlordCompany2.Text.ToUpper.Trim Then
            trLandlordCompany.BgColor = "#A4DB90"
        End If

        If lblLandlordCompanyNo1.Text.ToUpper.Trim <> lblLandlordCompanyNo2.Text.ToUpper.Trim Then
            trLandlordCompanyNo.BgColor = "#A4DB90"
        End If

        If lblLandlordContactPerson1.Text.ToUpper.Trim <> lblLandlordContactPerson2.Text.ToUpper.Trim Then
            trLandlordContactPerson.BgColor = "#A4DB90"
        End If

        If lblLandlordAddress1.Text.ToUpper.Trim <> lblLandlordAddress2.Text.ToUpper.Trim Then
            trLandlordAddress.BgColor = "#A4DB90"
        End If

        If lblLandlordPhone1.Text.ToUpper.Trim <> lblLandlordPhone2.Text.ToUpper.Trim Then
            trLandlordPhone.BgColor = "#A4DB90"
        End If

        If lblLandlordMobile1.Text.ToUpper.Trim <> lblLandlordMobile2.Text.ToUpper.Trim Then
            trLandlordMoible.BgColor = "#A4DB90"
        End If

        If lblLandlordFax1.Text.ToUpper.Trim <> lblLandlordFax2.Text.ToUpper.Trim Then
            trLandlordFax.BgColor = "#A4DB90"
        End If

        If lblLandlordEmail1.Text.ToUpper.Trim <> lblLandlordEmail2.Text.ToUpper.Trim Then
            trLandlordEmail.BgColor = "#A4DB90"
        End If

        If lblLandlordVMT1.Text.ToUpper.Trim <> lblLandlordVMT2.Text.ToUpper.Trim Then
            trLandlordVMT.BgColor = "#A4DB90"
        End If

        If lblLandlordIncomeTax1.Text.ToUpper.Trim <> lblLandlordIncomeTax2.Text.ToUpper.Trim Then
            trLandlordIncomeTax.BgColor = "#A4DB90"
        End If

        If lblLandlordReferral1.Text.ToUpper.Trim <> lblLandlordReferral2.Text.ToUpper.Trim Then
            trLandlordReferral.BgColor = "#A4DB90"
        End If

        If lblLandlordReferralName1.Text.ToUpper.Trim <> lblLandlordReferralName2.Text.ToUpper.Trim Then
            trLandlordReferralName.BgColor = "#A4DB90"
        End If

        If lblLandlordReferralNRIC1.Text.ToUpper.Trim <> lblLandlordReferralNRIC2.Text.ToUpper.Trim Then
            trLandlordReferralNRIC.BgColor = "#A4DB90"
        End If

        If lblLandlordReferralContact1.Text.ToUpper.Trim <> lblLandlordReferralContact2.Text.ToUpper.Trim Then
            trLandlordReferralContact.BgColor = "#A4DB90"
        End If

        If lblLandlordReferralStatus1.Text.ToUpper.Trim <> lblLandlordReferralStatus2.Text.ToUpper.Trim Then
            trLandlordReferralStatus.BgColor = "#A4DB90"
        End If

        If lblLandlordReferralAmount1.Text.ToUpper.Trim <> lblLandlordReferralAmount2.Text.ToUpper.Trim Then
            trLandlordReferralAmount.BgColor = "#A4DB90"
        End If

        If lblAgencyFee1.Text.ToUpper.Trim <> lblAgencyFee2.Text.ToUpper.Trim Then
            trAgencyFee.BgColor = "#A4DB90"
        End If

        If lblGSTPaidBy1.Text.ToUpper.Trim <> lblGSTPaidBy2.Text.ToUpper.Trim Then
            trGSTPaidBy.BgColor = "#A4DB90"
        End If

        If lblGST1.Text.ToUpper.Trim <> lblGST2.Text.ToUpper.Trim Then
            trGST.BgColor = "#A4DB90"
        End If

        If lblListing1.Text.ToUpper.Trim <> lblListing2.Text.ToUpper.Trim Then
            trListing.BgColor = "#A4DB90"
        End If

        If lblLandlordTAFee1.Text.ToUpper.Trim <> lblLandlordTAFee2.Text.ToUpper.Trim Then
            trLandlordTAFee.BgColor = "#A4DB90"
        End If

        If lblTenantType1.Text.ToUpper.Trim <> lblTenantType2.Text.ToUpper.Trim Then
            trTenantType.BgColor = "#A4DB90"
        End If

        If lblTenantName11.Text.ToUpper.Trim <> lblTenantName12.Text.ToUpper.Trim Then
            trTenantName1.BgColor = "#A4DB90"
        End If

        If lblTenantName21.Text.ToUpper.Trim <> lblTenantName22.Text.ToUpper.Trim Then
            trTenantName2.BgColor = "#A4DB90"
        End If

        If lblTenantName31.Text.ToUpper.Trim <> lblTenantName32.Text.ToUpper.Trim Then
            trTenantName3.BgColor = "#A4DB90"
        End If

        If lblTenantNRIC11.Text.ToUpper.Trim <> lblTenantNRIC12.Text.ToUpper.Trim Then
            trTenantNRIC1.BgColor = "#A4DB90"
        End If

        If lblTenantNRIC21.Text.ToUpper.Trim <> lblTenantNRIC22.Text.ToUpper.Trim Then
            trTenantNRIC2.BgColor = "#A4DB90"
        End If

        If lblTenantNRIC31.Text.ToUpper.Trim <> lblTenantNRIC32.Text.ToUpper.Trim Then
            trTenantNRIC3.BgColor = "#A4DB90"
        End If

        If lblTenantCompany1.Text.ToUpper.Trim <> lblTenantCompany2.Text.ToUpper.Trim Then
            trTenantCompany.BgColor = "#A4DB90"
        End If

        If lblTenantCompanyNo1.Text.ToUpper.Trim <> lblTenantCompanyNo2.Text.ToUpper.Trim Then
            trTenantCompanyNo.BgColor = "#A4DB90"
        End If

        If lblTenantContactPerson1.Text.ToUpper.Trim <> lblTenantContactPerson2.Text.ToUpper.Trim Then
            trTenantContactPerson.BgColor = "#A4DB90"
        End If

        If lblTenantAddress1.Text.ToUpper.Trim <> lblTenantAddress2.Text.ToUpper.Trim Then
            trTenantAddress.BgColor = "#A4DB90"
        End If

        If lblTenantPhone1.Text.ToUpper.Trim <> lblTenantPhone2.Text.ToUpper.Trim Then
            trTenantPhone.BgColor = "#A4DB90"
        End If

        If lblTenantMobile1.Text.ToUpper.Trim <> lblTenantMobile2.Text.ToUpper.Trim Then
            trTenantMobile.BgColor = "#A4DB90"
        End If

        If lblTenantFax1.Text.ToUpper.Trim <> lblTenantFax2.Text.ToUpper.Trim Then
            trTenantFax.BgColor = "#A4DB90"
        End If

        If lblTenantEmail1.Text.ToUpper.Trim <> lblTenantEmail2.Text.ToUpper.Trim Then
            trTenantEmail.BgColor = "#A4DB90"
        End If

        If lblTenantVMT1.Text.ToUpper.Trim <> lblTenantVMT2.Text.ToUpper.Trim Then
            trTenantVMT.BgColor = "#A4DB90"
        End If

        If lblTenantIncomeTax1.Text.ToUpper.Trim <> lblTenantIncomeTax2.Text.ToUpper.Trim Then
            trTenantIncomeTax.BgColor = "#A4DB90"
        End If

        If lblTenantReferral1.Text.ToUpper.Trim <> lblTenantReferral2.Text.ToUpper.Trim Then
            trTenantReferral.BgColor = "#A4DB90"
        End If

        If lblTenantReferralName1.Text.ToUpper.Trim <> lblTenantReferralName2.Text.ToUpper.Trim Then
            trTenantReferralName.BgColor = "#A4DB90"
        End If

        If lblTenantReferralNRIC1.Text.ToUpper.Trim <> lblTenantReferralNRIC2.Text.ToUpper.Trim Then
            trTenantReferralNRIC.BgColor = "#A4DB90"
        End If

        If lblTenantReferralContact1.Text.ToUpper.Trim <> lblTenantReferralContact2.Text.ToUpper.Trim Then
            trTenantReferralContact.BgColor = "#A4DB90"
        End If

        If lblTenantReferralStatus1.Text.ToUpper.Trim <> lblTenantReferralStatus2.Text.ToUpper.Trim Then
            trTenantReferralStatus.BgColor = "#A4DB90"
        End If

        If lblTenantReferralAmount1.Text.ToUpper.Trim <> lblTenantReferralAmount2.Text.ToUpper.Trim Then
            trTenantReferralAmount.BgColor = "#A4DB90"
        End If

        If lblDisbursementFee1.Text.ToUpper.Trim <> lblDisbursementFee2.Text.ToUpper.Trim Then
            trDisbursementFee.BgColor = "#A4DB90"
        End If

        If lblDeposit1.Text.ToUpper.Trim <> lblDeposit2.Text.ToUpper.Trim Then
            trDeposit.BgColor = "#A4DB90"
        End If

        If lblDepositMonth1.Text.ToUpper.Trim <> lblDepositMonth2.Text.ToUpper.Trim Then
            trDepositMonth.BgColor = "#A4DB90"
        End If

        If lblAdvance1.Text.ToUpper.Trim <> lblAdvance2.Text.ToUpper.Trim Then
            trAdvance.BgColor = "#A4DB90"
        End If

        If lblAdvanceMonth1.Text.ToUpper.Trim <> lblAdvanceMonth2.Text.ToUpper.Trim Then
            trAdvanceMonth.BgColor = "#A4DB90"
        End If

        If lblWaterElectric1.Text.ToUpper.Trim <> lblWaterElectric2.Text.ToUpper.Trim Then
            trWaterElectric.BgColor = "#A4DB90"
        End If

        If lblWaterElectric1.Text.ToUpper.Trim <> lblWaterElectric2.Text.ToUpper.Trim Then
            trWaterElectric.BgColor = "#A4DB90"
        End If

        If lblTel1.Text.ToUpper.Trim <> lblTel2.Text.ToUpper.Trim Then
            trTel.BgColor = "#A4DB90"
        End If

        If lblTenantTAFee1.Text.ToUpper.Trim <> lblTenantTAFee2.Text.ToUpper.Trim Then
            trTenantTAFee.BgColor = "#A4DB90"
        End If

        If lblWaterElectric1.Text.ToUpper.Trim <> lblWaterElectric2.Text.ToUpper.Trim Then
            trWaterElectric.BgColor = "#A4DB90"
        End If

        If lblSignDate1.Text.ToUpper.Trim <> lblSignDate2.Text.ToUpper.Trim Then
            trSignDate.BgColor = "#A4DB90"
        End If

        If lblSignRemark1.Text.ToUpper.Trim <> lblSignRemark2.Text.ToUpper.Trim Then
            trSignRemark.BgColor = "#A4DB90"
        End If

        If lblSignCompletion1.Text.ToUpper.Trim <> lblSignCompletion2.Text.ToUpper.Trim Then
            trSignCompletion.BgColor = "#A4DB90"
        End If

        If lblSignCompletionBy1.Text.ToUpper.Trim <> lblSignCompletionBy2.Text.ToUpper.Trim Then
            trSignCompleteBy.BgColor = "#A4DB90"
        End If

        If lblSignCompletionDate1.Text.ToUpper.Trim <> lblSignCompletionDate2.Text.ToUpper.Trim Then
            trSignCompleteDate.BgColor = "#A4DB90"
        End If

        If lblCommencementDate1.Text.ToUpper.Trim <> lblCommencementDate2.Text.ToUpper.Trim Then
            trCommencementDate.BgColor = "#A4DB90"
        End If

        If lblRentFreePeriod1.Text.ToUpper.Trim <> lblRentFreePeriod2.Text.ToUpper.Trim Then
            trRentFreePeriod.BgColor = "#A4DB90"
        End If

        If lblCollectionDate1.Text.ToUpper.Trim <> lblCollectionDate2.Text.ToUpper.Trim Then
            trCollectDate.BgColor = "#A4DB90"
        End If

        If lblCollectedAmount1.Text.ToUpper.Trim <> lblCollectedAmount2.Text.ToUpper.Trim Then
            trCollectionAmt.BgColor = "#A4DB90"
        End If

        If lblCollectionRemark1.Text.ToUpper.Trim <> lblCollectionRemark2.Text.ToUpper.Trim Then
            trCollectionRemark.BgColor = "#A4DB90"
        End If

        If lblCollectionCompletion1.Text.ToUpper.Trim <> lblCollectionCompletion2.Text.ToUpper.Trim Then
            trCollectionCompletion.BgColor = "#A4DB90"
        End If

        If lblCollectionCompletionBy1.Text.ToUpper.Trim <> lblCollectionCompletion2.Text.ToUpper.Trim Then
            trCollectionCompletionBy.BgColor = "#A4DB90"
        End If

        If lblCollectionCompletionDate1.Text.ToUpper.Trim <> lblCollectionCompletionDate2.Text.ToUpper.Trim Then
            trCollectionCompletionDate.BgColor = "#A4DB90"
        End If

        If lblUndoDate1.Text.ToUpper.Trim <> lblUndoDate2.Text.ToUpper.Trim Then
            trUndoDate.BgColor = "#A4DB90"
        End If

        If lblUndoRemark1.Text.ToUpper.Trim <> lblUndoRemark2.Text.ToUpper.Trim Then
            trUndoRemark.BgColor = "#A4DB90"
        End If

        If lblUndoAmt1.Text.ToUpper.Trim <> lblUndoAmt2.Text.ToUpper.Trim Then
            trUndoAmt.BgColor = "#A4DB90"
        End If

        If lblUndoBy1.Text.ToUpper.Trim <> lblUndoBy2.Text.ToUpper.Trim Then
            trUndoBy.BgColor = "#A4DB90"
        End If

        If lblUndoAgencyFee1.Text.ToUpper.Trim <> lblUndoAgencyFee2.Text.ToUpper.Trim Then
            trUndoAgencyFee.BgColor = "#A4DB90"
        End If

        If lblUndoGST1.Text.ToUpper.Trim <> lblUndoGST2.Text.ToUpper.Trim Then
            trUndoGST.BgColor = "#A4DB90"
        End If

        If lblUndoGSTPaidBy1.Text.ToUpper.Trim <> lblUndoGSTPaidBy2.Text.ToUpper.Trim Then
            trUndoGSTPaidBy.BgColor = "#A4DB90"
        End If
        If lblUndoListerAmount1.Text.ToUpper.Trim <> lblUndoListerAmount2.Text.ToUpper.Trim Then
            trUndoListerAmount.BgColor = "#A4DB90"
        End If
    End Sub
   
    Protected Sub btnBack_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnBack.Click
        If Session("Back") Is Nothing Then
            Response.Redirect("translist.aspx")
        Else
            Dim strBack As String = Session("Back").ToString
            Dim arr() As String = strBack.Split("ڡ")
            Response.Redirect(arr(0).ToString)
        End If
    End Sub
End Class
